<html>
<head>
	<title>Bouncy Metroid</title>
	<script type="text/javascript">
		R = 0;
		i = 1; 	
		function go() {
			metroidID			= document.getElementById("metroid");
			metroidID.src		= "m" + i + ".png";
			metroidID			= metroidID.style;
			metroidID.display	= "inline";
			metroidID.position	= "fixed";
			metroidID.left		= R + "px";
			metroidID.top		= Math.sin(R * Math.PI/180)*100 + "px";
			R = (R + 3*i);
			if(R <= 0 || R >= (window.innerWidth - 450)) {	i = i * -1;	}
		}
	</script>
</head>
<body>
	<button onclick="go(); setInterval('go()', 1);">Go!</button>
	<img src="m1.png" id="metroid" />
</body>
</html>	

